<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Vcode extends Lin_Controller{
    function __construct(){
        parent::__construct();
        $this->load->library('session');
        //加载验证码类
        $this->load->library('authcode');
    }
    function index(){
    	$this->authcode->show();
    }
     
    function script(){
        $this->authcode->showScript();
    }
    
    /*
     * 检测验证码和处理投票
     */
    function check(){
    	
        //调用authcode类中的check方法 判断验证码输入是否正确，ajax回传...
        if ($this->authcode->check(strtolower($this->uri->segment(3)))) {          
			
        	echo 1;//成功
            
        } else {
            echo 2;
        }
        
        
    }
    
    
}

 